home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 89 / maccd 89.iso / utilities / Mac OS X / ProcessWizard.dmg / ProcessWizard / ProcessWizard Daemon.app / Contents / Resources / renice.pl < prev    next >
Encoding:
Perl Script  |  2002-01-24  |  412 b   |  24 lines

  1. #!/usr/bin/perl
  2. # USAGE : renice.pl <nice> <pid> 
  3.  
  4. #($tmppath = $ARGV[0]) =~ s/(\&|'|")/\\\1/g; # escape &, ' and " chars with \
  5.  
  6. $nice = $ARGV[0];
  7. $pid = $ARGV[1];
  8.  
  9. open SHELL2, "renice $nice $pid |" or die "probleme";
  10.  
  11. # STDOUT: 759: old priority 0, new priority 1
  12. # ou
  13. # STDERR: renice: 759: setpriority: Permission denied
  14.  
  15. if(/.+ new priority (.+$)/)
  16. {
  17.     $newnice = $1;
  18. }
  19.  
  20. close SHELL2;
  21.  
  22. print $newnice;